#!/usr/bin/env python
# coding: utf-8

# In[3]:


print('Hello world','and HELLO TEACHER')


# In[1]:


a = input()
print(a)


# In[5]:


# 输入一个名字并显示，ctrl+/
name = input('please enter your name:')
print('hello,',name,'!')


# In[10]:


#数据类型之分数型,tab自动补全函数；
# 构建函数
import fractions
x = fractions.Fraction(3,10)
y = fractions.Fraction(0.5)
c = fractions.Fraction(2, 4)
print(x)
print(y)
print(c)


# In[11]:


#数据类型之整数
print(0O17)


# In[12]:


print(0x17)


# In[13]:


x = -1
if x == True:
    print('haha')
else:
    print('heihei')


# In[14]:


print(1 < 2 and 3 > 4)


# In[15]:


print( 1<= 2 or 3 >= 4)


# In[17]:


print(not 1 < 2)
print(1 < 3 < 5)


# In[18]:


comp = 1 + 2j
print(comp)


# In[19]:


num = complex(1,2)
print(num)


# In[21]:


#空值
spam = print('Hello')
print(None == spam)


# In[22]:


# 反斜杠+引号，就是代表引号
print('I\'m \"not OK\"!')


# In[23]:


#\n,换行
print('AAAA\nBBBBB') 


# In[24]:


#连个双引号，也代表一个引号
print('D:\\PYTHON')


# In[25]:


#取下整，地板除，floor
print(10//3)


# In[26]:


print(11//3)


# In[32]:


#模运算,取余数
print(10%3)
print(10.8/3)


# In[29]:


n = 123
print(n)


# In[30]:


f = 456.789
print(f)


# In[33]:


s1 = 'Hello,world'
s2 = 'Hello, \'Adam\''
print(s1,s2)


# In[35]:


s3 = r'Hello,"Bart'''
print(s3)


# In[37]:


s4 = r'''Hello, 
Lisa!'''
print(s4)


# In[38]:


print('\u4e2d\u6587')


# In[39]:


print('ABC'.encode('ascii'))


# In[40]:


print(b'\xe4\xb8\xad\xe6\x96\x87'.decode('utf-8'))


# In[42]:


#格式化输出字符串
name = input('please enter your name:')
print('hello,%s' %name)


# In[43]:


name = 'eve'
money = 10000
print('Hi,%s,you have $%d.' %(name,money))


# In[52]:


name = 'eve'
money = 100.456
print('Hi,%-10s,you have $%015.2f' %(name,money))
print('Hi,%-10s,you have $%-15.2f' %('Taryna',30000.456))


# In[57]:


#格式化输出字符串，format()
name = 'eve'
money = 100.456
print('Hi,{0},you have ${1:.1f}'.format(name,money))
print('Hi,%-10s,you have $%015.2f%%' %('ryna',30000.456))


# In[ ]:




